~ chicken-core (master) /manual/Module (scheme process-context)
Trap1[[tags: manual]]
2[[toc:]]
3
4== Module (scheme process-context
5
6<procedure>(command-line)</procedure>
7
8Returns the command line passed to the process as a list of strings. The first
9string corresponds to the command name. It is
10an error to mutate any of these strings.
11
12<procedure>(exit [obj])</procedure>
13
14Runs all outstanding dynamic-wind after procedures, terminates the running program, and communicates an exit
15value to the operating system. If no argument is supplied, or if
16obj is #t, the exit procedure should communicate to the operating system that
17the program exited normally. If
18obj is #f, the exit procedure should communicate to the operating system that
19the program exited abnormally. Otherwise, exit should translate
20obj into an appropriate exit value for the operating system, if possible.
21
22The exit procedure must not signal an exception or return to its continuation.
23
24Note: Because of the requirement to run handlers, this procedure is not
25just the operating system's exit procedure.
26
27<procedure>(emergency-exit [obj])</procedure>
28
29Terminates the program without running any outstanding dynamic-wind
30after procedures and communicates an exit value to the operating system in the
31same manner as exit.
32
33Note: The emergency-exit procedure corresponds to the _exit procedure in
34Windows and Posix.
35
36<procedure>(get-environment-variable name)</procedure>
37
38Many operating systems provide each running process with an environment
39consisting of environment variables. (This environment is not to be confused
40with the Scheme environments that can be passed to eval)
41Both the name and value of an environment variable are strings. The procedure
42get-environment-variable returns the value of the environment variable
43name, or #f if the named environment variable is not found. It may use locale
44information to encode the name and decode the value of the environment
45variable. It is an error if
46get-environment-variable can’t decode the value. It is also an error to mutate
47the resulting string.
48
49 (get-environment-variable "PATH")
50 ==> "/usr/local/bin:/usr/bin:/bin"
51
52<procedure>(get-environment-variables)</procedure>
53
54Returns the names and values of all the environment variables as an alist,
55where the car of each entry is the name of an environment variable and the cdr
56is its value, both as strings. The order of the list is unspecified. It is an
57error to mutate any of these strings or the alist itself.
58
59 (get-environment-variables)
60 ==> (("USER" . "root") ("HOME" . "/"))
61
62---
63Previous: [[Module (scheme lazy)]]
64
65Next: [[Module (scheme read)]]